﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Usuarios.aspx.cs" Inherits="ForrajeriaFRONT.ABM.Usuarios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            height: 66px;
        }
        .style36
        {
            height: 24px;
            width: 104px;
        }
        .style49
        {
            height: 24px;
            width: 178px;
        }
        .style142
        {
            width: 100%;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />

    <asp:Panel ID="panelBusca" runat="server">
          <div>
            <table class="style2">
                <tr>
                    <td class="style49">
                        <asp:Label ID="lblNuevoUser" runat="server" Text="Registrar Nuevo Usuario" 
                            Font-Bold="True"></asp:Label>
                    </td>
                    <td class="style36">
                        <asp:Button ID="btnNuevo" runat="server" CausesValidation="false" 
                             style="margin-left: 0px" Text="Nuevo" onclick="btnNuevo_Click"  />
                    </td>
                </tr>
                <tr>
                    <td class="style49">
                        &nbsp;</td>
                        <td class="style36"></td>
                    <td>
                        <asp:Label ID="mensaje" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="style49">
                        <asp:Label ID="lblBuscar" runat="server" Text="Usuarios" 
                            Font-Bold="True"></asp:Label>
                    </td>
                    <td class="style36">
                        
                    </td>
                    <td><asp:Label ID="lblMensaje" runat="server" /></td>
                </tr>
            </table>
        </div>
       
        <div>
<asp:GridView ID="gridDatos" runat="server" CellPadding="4" ForeColor="#333333" 
                GridLines="None" AutoGenerateColumns="False" 
                EmptyDataText="No hay forrajes para mostrar" 
                onselectedindexchanging="gridDatos_SelectedIndexChanging" 
                onrowdeleting="gridDatos_RowDeleting" 
                DataKeyNames="CodigoUsuario,CodigoCliente,CodigoEmpleado">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:BoundField DataField="User" HeaderText="Usuario" />
        <asp:BoundField DataField="Roles" HeaderText="Permiso" />
        <asp:CommandField ButtonType="Image" CancelText="" DeleteText="" 
            EditText="Editar" HeaderText="Editar" InsertText="" NewText="" 
            SelectImageUrl="~/Images/modificarABM.jpg" SelectText="select" 
            ShowSelectButton="True" UpdateText="" />
        <asp:CommandField ButtonType="Image" CancelText="" 
            DeleteImageUrl="~/Images/borrarABM.jpg" DeleteText="" EditText="" 
            HeaderText="Quitar" InsertText="" NewText="" SelectText="" 
            ShowDeleteButton="True" ShowHeader="True" UpdateText="" />
    </Columns>
    <EditRowStyle BackColor="#7C6F57" />
    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#E3EAEB" />
    <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F8FAFA" />
    <SortedAscendingHeaderStyle BackColor="#246B61" />
    <SortedDescendingCellStyle BackColor="#D4DFE1" />
    <SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>

        </div>
    

        </asp:Panel>

    <asp:Panel ID="panelCarga" runat="server" Visible="False">
    <h4> Registrar Usuario:</h4>

    <table class="style142" >
        <tr>
            <td>
                <asp:Label ID="lblDatosUser" runat="server" Font-Size="Large" 
                    Text="Datos Usuario" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td colspan="2">
                <asp:Label ID="lbldatosCliEmp" runat="server" Font-Size="Large" 
                    Text="Datos Cliente/Empleado" />
                <asp:RequiredFieldValidator ID="reqNombre" runat="server" 
                    ControlToValidate="txtNombre" 
                    ErrorMessage="Debe Seleccionar un Cliente/Empleado" ForeColor="Red" Text="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblseleccione" runat="server" Text="Seleccione:" />
            </td>
            <td>
                <asp:RadioButton ID="rbEmpleado" runat="server" Checked="true" 
                    GroupName="usuEmp" Text="Empleado" ViewStateMode="Enabled" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="btnBuscar" runat="server" CausesValidation="false" 
                    onclick="btnBuscar_Click" Text="Buscar" />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:RadioButton ID="rbCliente" runat="server" GroupName="usuEmp" 
                    Text="Cliente" ViewStateMode="Enabled" Width="130px" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="lblCodigo" runat="server" Text="Codigo" />
            </td>
            <td>
                <asp:TextBox ID="txtCodigo" runat="server" 
                    ReadOnly="true" Width="150px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblUsser" runat="server" Text="Usuario:" />
            </td>
            <td>
                <asp:TextBox ID="txtUsuario" runat="server" Width="150px" />
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtUsuario" ForeColor="Red" Text="*" 
                    ErrorMessage="Debe ingresar un Usuario"></asp:RequiredFieldValidator>
                <asp:CustomValidator ID="CustomValidator1" runat="server" 
                    ControlToValidate="txtUsuario" ErrorMessage="Usuario Existente" ForeColor="Red" 
                    onservervalidate="CustomValidator1_ServerValidate">*</asp:CustomValidator>
            </td>
            <td>
                <asp:Label ID="lblNombre" runat="server" Text="Nombre:" />
            </td>
            <td>
                <asp:TextBox ID="txtNombre" runat="server" ReadOnly="true" Width="150px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblPass" runat="server" Text="Password:" Visible="False" />
            </td>
            <td>
                <asp:Button ID="btnReset" runat="server" Text="Reset" 
                    onclick="btnReset_Click" Visible="False" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="lblApellido" runat="server" Text="Apellido:" />
            </td>
            <td>
                <asp:TextBox ID="txtApellido" runat="server" ReadOnly="true" Width="150px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblRol" runat="server" Text="Permisos:"></asp:Label>
            </td>
            <td>
                <asp:CheckBox ID="chkAdmin" runat="server" Text="Administrador" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="lbltipoDoc" runat="server" Text="Tipo Doc." />
            </td>
            <td>
                <asp:DropDownList ID="ddlTipoDoc" runat="server" Enabled="false" Width="150px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:CheckBox ID="chkVentas" runat="server" Text="Ventas" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="nroDoc" runat="server" Text="Nro Doc:" />
            </td>
            <td>
                <asp:TextBox ID="txtNroDoc" runat="server" ReadOnly="true" Width="150px" />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:CheckBox ID="chkStock" runat="server" Text="Stock" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="lblTelefono" runat="server" Text="Telefono:" />
            </td>
            <td>
                <asp:TextBox ID="txtTelefono" runat="server" ReadOnly="true" Width="150px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnVolver" runat="server" CausesValidation="False" 
                    onclick="btnVolver_Click" Text="Volver" />
            </td>
            <td>
                <asp:Button ID="btnGuardar" runat="server" onclick="btnGuardar_Click" 
                    Text="Guardar" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    

        
    

    </asp:Panel>
<asp:Panel ID="PanelCliente" runat="server" Visible="False">
    <asp:GridView ID="gvClientes" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="Telefono,TipoDocumento,Codigo" ForeColor="#333333" 
        GridLines="None" onselectedindexchanging="gvClientes_SelectedIndexChanging" 
        Visible="False" EmptyDataText="No hay Datos para Mostrar">

        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ApellidoCliente" HeaderText="Apellido" />
            <asp:BoundField DataField="NombreCliente" HeaderText="Nombre" />
            <asp:BoundField DataField="NumeroDocumento" HeaderText="Documento" />
            <asp:CommandField ButtonType="Image" 
                SelectImageUrl="~/Images/selectBusqueda.jpg" ShowSelectButton="True" />
        </Columns>
        <EditRowStyle BackColor="#66FF33" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#339933" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#CCFF99" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />

    </asp:GridView>

    <asp:GridView ID="gvEmpleados" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" Visible="False" 
        onselectedindexchanging="gvEmpleados_SelectedIndexChanging" 
        DataKeyNames="Telefono,TipoDocumento,Codigo" 
        EmptyDataText="No hay datos para mostrar">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Apellido" HeaderText="Apellido" />
            <asp:BoundField DataField="Nombre" HeaderText="Nombre" />
            <asp:BoundField DataField="NroDocumento" HeaderText="Documento" />
            <asp:CommandField ButtonType="Image" 
                SelectImageUrl="~/Images/selectBusqueda.jpg" ShowSelectButton="True" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#339933" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#CCFF99" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
</asp:Panel>


        
</asp:Content>
